#include <iostream>
#include <string>
using namespace std;

int main()
{
   //freopen("t.txt","w",stdout);
    string s;
    int len=0;
    while(cin>>s)
    {
       if(s=="<br>")
       {
           cout<<endl;
           len=0;
       }
       else if(s=="<hr>")
       {
           if(len!=0)
            cout<<endl;
            int n=80;
            while(n--)cout<<'-';
            cout<<endl;
            len=0;
       }
       else
       {
           if(len+s.size()+1>80)
           {
                cout<<endl;
                len=0;
           }
            if(len<80&&len!=0)
            {
                cout<<" ";
                len++;
            }
            cout<<s;
            len+=s.size();
       }
    }
    cout<<endl;
    return 0;
}
